package com.example.lanqiaodemo1.LanQiao;

import java.util.HashSet;

import java.util.Set;

/**
 * @author yt1105
 * @version 1.0
 */
//1.11-
//年龄的四次方是6位数 立方是个4位数
//10个数字 正好包含0 到9这10个数字
public class Lq1 {

    public static void main(String[] args) {
        for (int age = 11; age < 100; age++) {
            String age3 = (age * age * age) + "";
            String age4 = (age * age * age * age) + "";
            if (age3.length() == 4 && age4.length() == 6 && check(age3, age4)) {
                System.out.println(age);
                break;
            }
        }
    }

    public static boolean check(String age3, String age4) {
        String age = age3 + age4;
        Set<Character> set = new HashSet<Character>();
        for (int i = 0; i < age.length(); i++) {
            set.add(age.charAt(i));
        }
        return set.size() == 10;
    }
}

